package T6;

public class Node {
//    默认修饰符  private修饰符在 LinkedList无法使用
     Object data;
     Node next;
    public Node(Object data) {
        this.data = data;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Node getNext() {
        return next;
    }

    public void setNext(Node next) {
        this.next = next;
    }

    @Override
    public String toString() {
//        把data转换成字符串
        return String.valueOf(data);
    }
    
}
